package com.hqyj.lyf.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hqyj.lyf.mapper.ExamQuestionBankMapper;

import com.hqyj.lyf.pojo.ExamQuestionBank;

import com.hqyj.lyf.pojo.QuestionBank;
import com.hqyj.lyf.service.ExamQuestionBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Qiuluoer
 *  2022/5/28 14:18
 */
@Service
public class ExamQuestionBankServiceImpl extends ServiceImpl<ExamQuestionBankMapper, ExamQuestionBank> implements ExamQuestionBankService {

    @Autowired
    private ExamQuestionBankService examQuestionBankService;
    @Autowired
    private ExamQuestionBankMapper examQuestionBankMapper;
    @Override
    public Boolean addExamQuestion(List<Integer> quIds,Integer examPaperId) {
        ArrayList<ExamQuestionBank> examQuestionBanks = new ArrayList<>();
        for(Integer quid:quIds){
            examQuestionBanks.add(new ExamQuestionBank(examPaperId,quid));
        }
        boolean blag = examQuestionBankService.saveBatch(examQuestionBanks);
        return blag;
    }

    @Override
    public QuestionBank queryByexamPaperId(Integer examPaperId) {
        return null;
    }
}
